//
//  BankView.m
//  Project two framework
//
//  Created by rimi on 16/7/29.
//  Copyright © 2016年 张峥. All rights reserved.
//

#import "BankView.h"

@implementation BankView


+ (instancetype)showOtherView
{
    static BankView *bankView = nil;
    bankView = [[BankView alloc]init];
    return bankView;
}

- (instancetype)init
{
    self = [super init];
    if (self) {
        [self addOtherView];
    }
    return self;
}

- (void)addOtherView
{
    [super addOtherView];
    [self.imageView addSubview:self.topLine];
    [self.imageView addSubview:self.bottomLine];
    [self.imageView addSubview:self.limit];
    [self.imageView addSubview:self.earnings];
    [self.imageView addSubview:self.money];
    [self.imageView addSubview:self.maturity];
    [self.imageView addSubview:self.chinabank];
    [self.imageView addSubview:self.start];
    [self.imageView addSubview:self.stop];
    [self.imageView addSubview:self.interest];
    [self.imageView addSubview:self.lines];
}

- (UIView *)topLine
{
    if (_topLine == nil) {
        _topLine = ({
            UIView *view = [[UIView alloc]initWithFrame:CGRectMake(50, CGRectGetMaxY(self.nameLabel.bounds) + 50, CGRectGetMaxX(self.imageView.bounds) - 100, 1)];
            view.backgroundColor = [UIColor grayColor];
            view;
        });
    }
    return _topLine;
}

- (UIView *)bottomLine
{
    if (_bottomLine == nil) {
        _bottomLine = ({
            UIView *view = [[UIView alloc]initWithFrame:CGRectMake(50, 450, CGRectGetMaxX(self.imageView.bounds) - 100, 1)];
            view.backgroundColor = [UIColor grayColor];
            view;
        });
    }
    return _bottomLine;
}

- (UILabel *)limit
{
    if (_limit == nil) {
        _limit = ({
            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(150, CGRectGetMaxY(self.topLine.frame) + 50, 300, 50)];
            label.textAlignment = NSTextAlignmentLeft;
            label.font = [UIFont boldSystemFontOfSize:16];
            label;
        });
    }
    return _limit;
}

- (UILabel *)earnings
{
    if (_earnings == nil) {
        _earnings = ({
            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(150, CGRectGetMaxY(self.limit.frame) , 300, 50)];
            label.textAlignment = NSTextAlignmentLeft;
            label.font = [UIFont boldSystemFontOfSize:16];
            label;
        });
    }
    return _earnings;
}

- (UILabel *)money
{
    if (_money == nil) {
        _money = ({
            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(150, CGRectGetMaxY(self.earnings.frame) , 300, 50)];
            label.textAlignment = NSTextAlignmentLeft;
            label.font = [UIFont boldSystemFontOfSize:16];
            label;
        });
    }
    return _money;
}

- (UILabel *)maturity
{
    if (_maturity == nil) {
        _maturity = ({
            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(150, CGRectGetMaxY(self.money.frame) , 300, 50)];
            label.textAlignment = NSTextAlignmentLeft;
            label.font = [UIFont boldSystemFontOfSize:16];
            label;
        });
    }
    return _maturity;
}

- (UILabel *)chinabank
{
    if (_chinabank == nil) {
        _chinabank = ({
            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(150, CGRectGetMaxY(self.maturity.frame) , 300, 50)];
            label.textAlignment = NSTextAlignmentLeft;
            label.font = [UIFont boldSystemFontOfSize:16];
            label;
        });
    }
    return _chinabank;
}

- (UILabel *)start
{
    if (_start == nil) {
        _start = ({
            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(450, CGRectGetMaxY(self.topLine.frame) + 50, 300, 50)];
            label.textAlignment = NSTextAlignmentLeft;
            label.font = [UIFont boldSystemFontOfSize:16];
            label;
        });
    }
    return _start;
}
- (UILabel *)stop
{
    if (_stop == nil) {
        _stop = ({
            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(450, CGRectGetMaxY(self.start.frame) , 300, 50)];
            label.textAlignment = NSTextAlignmentLeft;
            label.font = [UIFont boldSystemFontOfSize:16];
            label;
        });
    }
    return _stop;
}
- (UILabel *)interest
{
    if (_interest == nil) {
        _interest = ({
            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(450, CGRectGetMaxY(self.stop.frame) , 300, 50)];
            label.textAlignment = NSTextAlignmentLeft;
            label.font = [UIFont boldSystemFontOfSize:16];
            label;
        });
    }
    return _interest;
}
- (UILabel *)lines
{
    if (_lines == nil) {
        _lines = ({
            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(450, CGRectGetMaxY(self.interest.frame) , 300, 50)];
            label.textAlignment = NSTextAlignmentLeft;
            label.font = [UIFont boldSystemFontOfSize:16];
            label;
        });
    }
    return _lines;
}
@end
